extend
Create extensions for types you don't own with extension traits but without the boilerplate.
Example:
use ext;
How does it work?
Under the hood it generates a trait with methods in your impl
and implements those for the
type you specify. The code shown above expands roughly to:
Configuration
You can configure:
- The visibility of the trait. The default visibility is private. Example:
#[ext(pub)]
. This must be the first argument to the attribute - The name of the generated extension trait. Example:
#[ext(name = MyExt)]
. - Whether or not the generated trait should be sealed. Example:
#[ext(sealed = false)]
. The default istrue
.
More examples:
use ext;
License: MIT